x86/pv: Correctly fold vIOPL back into vcpu_guest_context
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 11 Apr 2016 09:03:55 +0000 (10:03 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 11 Apr 2016 14:21:16 +0000 (10:21 -0400)
commit972523bcefe215b46ffd74fa08b8199cec2fde05
tree99ceb43b45e7e9b1e6bcde27fe8ca5ddc0d3af77
parent7f3f61699b990da505c70d4c716610caebb63e21
x86/pv: Correctly fold vIOPL back into vcpu_guest_context

c/s f71ecb6 "x86: introduce a new VMASSIST for architectural behaviour of
iopl" shifted the vcpu iopl field by 12, but didn't update the logic which
reconstructs the guests eflags for migration.

Existing guest kernels set a vIOPL of 1, to prevent them from faulting when
accessing IO ports.  This bug manifests as a crash after migrate, as the vIOPL
reverts back to the default of 0, and the guest suffers an unexpected #GP
fault.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/domctl.c